﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebSite.Core;

namespace WebSite.ThirdPartyLogin
{
    public partial class CarrefourAuth : BasePage
    {
        public override bool NeedLogin
        {
            get
            {
                return false;
            }
        }

        protected void Page_Load( object sender, EventArgs e )
        {

        }

        protected void tbLogin_Click( object sender, ImageClickEventArgs e )
        {
            string uid = tbUserName.Text.Trim();
            string pwd = tbPassword.Text.Trim();

            string result = CarrefourLoginHelper.CheckLogin( uid, pwd );
            if (result != "")
            {
                // AlertMessageBack( result );
                string username = "cf$$$" + uid.ToLower();

                LoginHelper.SetCurrentUser( username,false );
                ClientScript.RegisterStartupScript( this.GetType(), "succ", "loginsuccess()",true );
            }
            else
            {
                AlertMessageBack( "家乐福帐号用户名或密码错误" );
            }
        }
    }
}